package com.hailiang.study.javase.java.util;

import org.junit.Test;

import java.util.Arrays;

public class Arrays_equals {
    /**
     * 判断两个数组是否相等
     */
    @Test
    public void test_equals() {
        Integer[] num01 = {25,12,68,78,33,55};
        Integer[] num02 = {25,12,68,78,33,55};
        Boolean result = Arrays.equals(num01, num02);
        System.out.println(result); //true

        num01 = new Integer[] {25,12,68,78,33,55};
        num02 = new Integer[] {12,25,68,78,33,55};
        result = Arrays.equals(num01, num02);
        System.out.println(result); //false

        String[] str01 = {"Hello", "World", "Java"};
        String[] str02 = {"Hello", "World", "Java"};
        result = Arrays.equals(str01, str02);
        System.out.println(result); //true
    }
}
